package com.mi9688.stream;

import com.mi9688.lambda.Student;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

public class Filter {
    public static void main(String[] args) {
        List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        // 过滤并打印出所有偶数
        Stream<Integer> evenNumbers = numbers.stream().filter(n -> n % 2 == 0);
        evenNumbers.forEach(System.out::println);

    }
}
